import request from "@/utils/request.js";

/**
 * 任务单接口
 * @param params
 * @returns {AxiosPromise}
 */
export function getListTask(params) {
  return request({
    url: "/jk/GetTaskList?input=" + JSON.stringify(params),
    method: "post"
  });
}

/**
 * @param params
 * @returns {AxiosPromise}
 */
export function updateState(params) {
  return request({
    url: "/jk/updateState",
    method: "post",
    data: params
  });
}

/**
 * @param params
 * @returns {AxiosPromise}
 */
export function GetModuleListByCompanyNo(params) {
  return request({
    url: "/jk/GetModuleListByCompanyNo",
    method: "post",
    data: params
  });
}

/**
 * @returns {AxiosPromise}
 * @param info
 * @param service
 * @param hrs
 */
export function SaveTask(info = {}, service = [], hrs = []) {
  let i = JSON.stringify(info);
  let s = JSON.stringify(service);
  let h = JSON.stringify(hrs);
  return request({
    url: `/jk/SaveTask?orderInfo=${i}&moduleListInfo=${s}&taskListInfo=${h}`,
    method: "post"
    //data: params
  });
}

/**
 * @param params
 * @returns {AxiosPromise}
 */
export function GetOrderCompany(params) {
  return request({
    closeInterceptors: true,
    url: "/jk/GetOrderCompany",
    method: "post",
    data: params
  });
}
